Skip to content

Fix PR reviewer: it was denied the tools needed to read code - #401

Merged
erikdarlingdata merged 1 commit into
devfrom
fix/claude-review-tools
Jul 25, 2026
Merged

Fix PR reviewer: it was denied the tools needed to read code#401
erikdarlingdata merged 1 commit into
devfrom
fix/claude-review-tools

Conversation

@erikdarlingdata

Copy link
Copy Markdown
Owner

Fixes the PR review workflow, which failed on its first real run.

What happened

The workflows went live with v1.17.0 (they need to be on the default branch). The first substantive PR they saw was #399, and the review failed:

permission_denials_count: 10
##[error]Execution failed: Reached maximum number of turns (20)

Root cause

--allowedTools replaces the default tool set rather than adding to it. The resolved list in the run log was exactly the four entries I passed:

"allowedTools": [
  "mcp__github_inline_comment__create_inline_comment",
  "Bash(gh pr comment:*)",
  "Bash(gh pr diff:*)",
  "Bash(gh pr view:*)"
]

No Read, no Grep, no Glob. So the prompt told the reviewer "the PR branch is already checked out in the working directory" and then denied it every tool needed to open a file. It spent its turns getting denied, hit the 20-turn cap, and posted nothing.

PR #400 passed only because its diff is two small files that fit inside the budget. That is why this looked like it worked.

Fix

  • Add Read, Grep, Glob, plus read-only git diff / git log
  • Raise --max-turns from 20 to 40, since a real review reads several files

Cost reference: the failed 20-turn run was $0.63, so a completed review should land in the low single digits of dollars.

Test plan

  • Workflow YAML parses; claude_args resolves to the intended flags
  • Cannot be verified on this PR - it edits claude-code-review.yml, so the action's default-branch content check skips it (expected, documented in the file). The real test is the first PR opened after this reaches main.

🤖 Generated with Claude Code

First live run of the review workflow failed on PR #399:

  permission_denials_count: 10
  ##[error]Execution failed: Reached maximum number of turns (20)

--allowedTools REPLACES the default tool set rather than adding to it,
so the resolved list was exactly the four entries I passed - no Read,
Grep, or Glob. The prompt tells the reviewer "the PR branch is already
checked out in the working directory", then denied it every tool needed
to open a file. It spent its turns on denied calls and hit the cap
without posting a review.

PR #400 passed only because its diff is two small files, so it fit.

Adds Read/Grep/Glob plus read-only git diff/log, and raises the cap to
40 turns since a real review needs to read several files.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@erikdarlingdata
erikdarlingdata merged commit 1b7acc6 into dev Jul 25, 2026
3 checks passed
@erikdarlingdata
erikdarlingdata deleted the fix/claude-review-tools branch July 25, 2026 16:19
This was referenced Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant